/**
 * Created by LIKUIHE on 2016/1/14.
 */
var getUrlParam  : (url : string, method : string)=>Object=
    function(url,method) {
        if (!method) {
            method = 'search';
        } else if((method !== 'search' && method !=='hash') || !url) {
            return {};
        }

        var a = document.createElement('a');
        a.href = url;

        var param = (a[method].length ? a[method].substring(1) : ''),
            json = {},
            items = param.length ? param.split('&') : [],
            item = null,
            name = null,
            val = null,
            l = items.length;

        for (var i = 0;i<l; i ++) {
            item = items[i].split('=');
            name = item[0];
            val = item[1];
            name.length && (json[name] = val);
        }

        return json;
    }